//
//  UITableViewCell+HDRepairDetailCell.m
//  app
//
//  Created by D on 15/8/31.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "HDRepairDetailCell.h"

static const CGFloat kMargin = 12.0f;
static const CGFloat kNameW = 86.0f;
static const CGFloat kNameH = 30.0f;
static const CGFloat kStatusW = 60.0f;
static const CGFloat kStatusH = 30.0f;
static const CGFloat kImageW = 64.0f;
static const CGFloat kCodeW = 200.0f;
static const CGFloat kMakeSureW = 84.0f;
static const CGFloat kMakeSureH = 44.0f;

@implementation HDRepairDetailCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier Section:(NSInteger)section
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        if (section == 0) {
            self.frame = CGRectMake(0, 0, UBO_WINDOW.width, 120);
        }else
        {
            self.frame = CGRectMake(0, 0, UBO_WINDOW.width, 44);
        }
        
    }
    return self;
}

-(void)cellWithModel:(HDRepairListModle *)model Section:(NSInteger)section Row:(NSInteger)row
{
    
    self.frame = CGRectMake(0, 0, UBO_WINDOW.width, 44);
    
    if (model.detail.count == 0) {
        if (section == 0) {
            
            self.frame = CGRectMake(0, 0, UBO_WINDOW.width, 120);
            
            UIButton * statusImage = [[UIButton alloc]initWithFrame:CGRectOf([self.ubo fx:UB_1_2 ox:-kImageW/2 fy:UB_1_2 oy:-kImageW/2-kMargin], [self.ubo ow:kImageW oh:kImageW])];
            if ([model.status isEqualToString:@"待处理"]) {
                
                [statusImage setBackgroundImage:[UIImage imageNamed:@"green_cir"] forState:UIControlStateNormal];
                
            }else
            {
                [statusImage setBackgroundImage:[UIImage imageNamed:@"black_cir"] forState:UIControlStateNormal];
                
            }
            [statusImage setTitle:model.status forState:UIControlStateNormal];
            [statusImage setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            [statusImage.titleLabel setFont:[UIFont systemFontOfSize:15]];
            [self addSubview:statusImage];
            
            CGFloat kCode = UBO_WINDOW.width - 4*kMargin;
            
            UILabel * nameLab = [[UILabel alloc]initWithFrame:CGRectOf([statusImage.ufo fx:UB_1_2 ox:-kCode/2 fy:1 oy:kMargin], [self.ubo ow:kCode oh:kNameH])];
            [nameLab setFont:[UIFont systemFontOfSize:14]];
            [nameLab setTextColor:[XCommon hexStringToColor:kColor_gray_text]];
            nameLab.text = [NSString stringWithFormat:@"申报单号：%@",model.code];
            [nameLab setTextAlignment:NSTextAlignmentCenter];
            [self addSubview:nameLab];
            
            if ([model.status isEqualToString:@"待处理"]) {
            
                
            
            }else
            {
                UIButton * btn = [[UIButton alloc]initWithFrame:CGRectOf([self.ubo fx:1 ox:-12-40 fy:UB_1_2 oy:-30/2], [self.ubo ow:40 oh:30])];
                [btn setTitle:@"评价" forState:UIControlStateNormal];
                [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
                btn.tag = model.repair_apply_id.integerValue;
                [btn.titleLabel setFont:[UIFont systemFontOfSize:12]];
                btn.titleLabel.text = @"仁和物业";
                [btn addTarget:self action:@selector(pingjia:) forControlEvents:UIControlEventTouchUpInside];
                [self addSubview:btn];
            
            }
            
            
            
        }
        else if (section == 1){
            
            CGFloat kContentW = UBO_WINDOW.width - 2*kMargin - kNameW;
            
            UILabel * nameLab = [[UILabel alloc]initWithFrame:CGRectOf([self.ubo fx:0 ox:kMargin fy:UB_1_2 oy:-kNameH/2], [self.ubo ow:kNameW oh:kNameH])];
            [nameLab setFont:[UIFont systemFontOfSize:14]];
            [nameLab setTextColor:[XCommon hexStringToColor:kColor_gray_text]];
            [self addSubview:nameLab];
            
            
            UILabel * contentLab = [[UILabel alloc]initWithFrame:CGRectOf([nameLab.ufo fx:1 fy:0], [self.ubo ow:kContentW oh:kNameH])];
            [contentLab setFont:[UIFont systemFontOfSize:14]];
            [contentLab setTextColor:[XCommon hexStringToColor:kColor_black_text]];
            [self addSubview:contentLab];
            
            
            if (row == 0) {
                
                nameLab.text = @"报修项目：";
                contentLab.text = model.repair_item;
                
            }
            else if (row == 1){
                
                nameLab.text = @"报修时间：";
                contentLab.text = model.creatTime;
                
            }
            else if (row == 2){
                
                nameLab.text = @"联 系 人 ：";
                contentLab.text = model.apply_name;
                
            }
            else if (row == 3){
                
                nameLab.text = @"维修地址：";
                contentLab.text = model.address;
                
            }
            else if (row == 4){
                nameLab.text = @"维修详情：";
                contentLab.text = model.info;
            }
            else if (row == 5){
                nameLab.text = @"参考维修费：";
                NSString * str = [NSString stringWithFormat:@"%@",model.reference_price];
                if (![str isEqualToString:@"<null>"]) {
                    contentLab.text = [NSString stringWithFormat:@"%@",model.reference_price];
                }else
                {
                    contentLab.text = @"00.00";
                }
                
                
                
                [nameLab setTextColor:[UIColor redColor]];
                [contentLab setTextColor:[UIColor redColor]];
            }
            else if (row == 6){
                
                self.userInteractionEnabled = YES;
                
                nameLab.text = @"维修图片：";
                contentLab.hidden = YES;
                
//                nameLab.backgroundColor = [UIColor blackColor];
                
                CGFloat picwidth = (UBO_SCREEN.width - nameLab.frame.size.width-4*5-12)/4;
                
                NSString * str = @"http://mylife114.com/repair_apply_images/";
                NSMutableArray * array = [NSMutableArray array];
                
                NSDictionary * dic = [model.images objectAtIndex:0];
                
                NSString * image1 = dic[@"image_1"];
                NSString * image2 = dic[@"image_2"];
                NSString * image3 = dic[@"image_3"];
                NSString * image4 = dic[@"image_4"];
                
                NSString * url1 = [NSString stringWithFormat:@"%@%@",str,image1];
                NSString * url2 = [NSString stringWithFormat:@"%@%@",str,image2];
                NSString * url3 = [NSString stringWithFormat:@"%@%@",str,image3];
                NSString * url4 = [NSString stringWithFormat:@"%@%@",str,image4];
                
                [array addObject:url1];
                [array addObject:url2];
                [array addObject:url3];
                [array addObject:url4];
                
                
                for (int i = 0; i < array.count; i++) {
                    
                    UIImageView * iv = [[UIImageView alloc]initWithFrame:CGRectOf([nameLab.ufo fx:1 ox:(i+1)*4+i*picwidth fy:0], [self.ubo ow:picwidth oh:picwidth])];
//                    iv.backgroundColor = [UIColor blueColor];
                    iv.userInteractionEnabled = YES;
                    [self addSubview:iv];
                    
                    [iv sd_setImageWithURL:[NSURL URLWithString:[array objectAtIndex:i]]];
                    
                                    
                    UIButton * btn = [[UIButton alloc]initWithFrame:CGRectOf([iv.ubo fx:0 fy:0], [iv.ubo ow:picwidth oh:picwidth])];
                    btn.tag = i;
//                    btn.backgroundColor = [UIColor blueColor];
                    btn.titleLabel.text = [array objectAtIndex:i];
                    [btn addTarget:self action:@selector(picTop:) forControlEvents:UIControlEventTouchUpInside];
                    [iv addSubview:btn];
                    
                    
                }
                
            
            }
            
            
            
        }
        else if (section == 2){
            
            CGFloat kContentW = UBO_WINDOW.width - 2*kMargin - kNameW;
            
            UILabel * nameLab = [[UILabel alloc]initWithFrame:CGRectOf([self.ubo fx:0 ox:kMargin fy:UB_1_2 oy:-kNameH/2], [self.ubo ow:kNameW oh:kNameH])];
            [nameLab setFont:[UIFont systemFontOfSize:14]];
            [nameLab setTextColor:[XCommon hexStringToColor:kColor_gray_text]];
            [self addSubview:nameLab];
            
            
            UILabel * contentLab = [[UILabel alloc]initWithFrame:CGRectOf([nameLab.ufo fx:1 fy:0], [self.ubo ow:kContentW oh:kNameH])];
            [contentLab setFont:[UIFont systemFontOfSize:14]];
            [contentLab setTextColor:[XCommon hexStringToColor:kColor_black_text]];
            [self addSubview:contentLab];
            
            
            if (row == 0) {
                
                nameLab.frame = CGRectOf([self.ubo fx:0 ox:kMargin fy:UB_1_2 oy:-kNameH/2], [self.ubo ow:120 oh:kNameH]);
                nameLab.text = @"是否有偿服务：";
                
                
                contentLab.frame = CGRectOf([nameLab.ufo fx:1 ox:2 fy:0], [self.ubo ow:kContentW oh:kNameH]);
                
                if (model.is_charged.integerValue == 0) {
                  contentLab.text = @"无偿";
                }else
                {
                    contentLab.text = @"有偿";
                }
                
                
                
                self.backgroundColor = [UIColor redColor];
                [nameLab setTextColor:[UIColor whiteColor]];
                [contentLab setTextColor:[UIColor whiteColor]];
                
                
                
                
            }
            else if (row == 1){
                
                nameLab.text = @"维 修 方 ：";
                contentLab.text = @"暂无信息";
                
            }
            else if (row == 2){
                
                nameLab.text = @"开始时间：";
                contentLab.text = @"暂无信息";
                
            }
            else if (row == 3){
                
                nameLab.text = @"结束时间：";
                contentLab.text = @"暂无信息";
                
            }
            else if (row == 4){
                nameLab.text = @"维修结果：";
                contentLab.text = @"暂无信息";
            
            }
            else if (row == 5){
            
                
                nameLab.text = @"录入时间：";
                contentLab.text = @"暂无信息";
                
                
            }
            else if (row == 6){
                
                nameLab.text = @"维修报价：";
                contentLab.text = @"00.00";
                
                [nameLab setTextColor:[UIColor redColor]];
                [contentLab setTextColor:[UIColor redColor]];

                
                if ([model.status isEqualToString:@"待处理"]) {
                    nameLab.hidden = YES;
                    contentLab.hidden = YES;
                }else
                {
                    nameLab.hidden = NO;
                    contentLab.hidden = NO;
                    
                }
                
                
            
            }
            else if (row == 7){
                
                
                nameLab.text = @"实际维修费：";
                contentLab.text = @"00.00";
                
                [nameLab setTextColor:[UIColor redColor]];
                [contentLab setTextColor:[UIColor redColor]];
                
                UIButton * btn = [[UIButton alloc]initWithFrame:CGRectOf([self.ubo fx:1 ox:-80 fy:0 ], [self.ubo ow:80 oh:kNameH])];
                [btn setTitle:@"-收费明细-" forState:UIControlStateNormal];
                [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
                [btn.titleLabel setFont:[UIFont systemFontOfSize:12]];
                [btn addTarget:self action:@selector(shoufeimingxi:) forControlEvents:UIControlEventTouchUpInside];
                [self addSubview:btn];
                
                
                
                if ([model.status isEqualToString:@"待处理"]) {
                    nameLab.hidden = YES;
                    contentLab.hidden = YES;
                    btn.hidden = YES;
                }else
                {
                    nameLab.hidden = NO;
                    contentLab.hidden = NO;
                    btn.hidden = NO;
                    
                }
                
            
            }
            
            
        }
    }else
    {
        if (section == 0) {
            
            self.frame = CGRectMake(0, 0, UBO_WINDOW.width, 120);
            
            UIButton * statusImage = [[UIButton alloc]initWithFrame:CGRectOf([self.ubo fx:UB_1_2 ox:-kImageW/2 fy:UB_1_2 oy:-kImageW/2-kMargin], [self.ubo ow:kImageW oh:kImageW])];
            if ([model.status isEqualToString:@"待处理"]) {
                
                [statusImage setBackgroundImage:[UIImage imageNamed:@"green_cir"] forState:UIControlStateNormal];
                
            }else
            {
                [statusImage setBackgroundImage:[UIImage imageNamed:@"black_cir"] forState:UIControlStateNormal];
                
            }
            [statusImage setTitle:model.status forState:UIControlStateNormal];
            [statusImage setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            [statusImage.titleLabel setFont:[UIFont systemFontOfSize:15]];
            [self addSubview:statusImage];
            
            CGFloat kCode = UBO_WINDOW.width - 4*kMargin;
            
            UILabel * nameLab = [[UILabel alloc]initWithFrame:CGRectOf([statusImage.ufo fx:UB_1_2 ox:-kCode/2 fy:1 oy:kMargin], [self.ubo ow:kCode oh:kNameH])];
            [nameLab setFont:[UIFont systemFontOfSize:14]];
            [nameLab setTextColor:[XCommon hexStringToColor:kColor_gray_text]];
            nameLab.text = [NSString stringWithFormat:@"申报单号：%@",model.code];
            [nameLab setTextAlignment:NSTextAlignmentCenter];
            [self addSubview:nameLab];
            
            if ([model.status isEqualToString:@"待处理"]) {
                
                
                
            }else
            {
                UIButton * btn = [[UIButton alloc]initWithFrame:CGRectOf([self.ubo fx:1 ox:-12-40 fy:UB_1_2 oy:-30/2], [self.ubo ow:40 oh:30])];
                [btn setTitle:@"评价" forState:UIControlStateNormal];
                [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
                btn.tag = model.repair_apply_id.integerValue;
                btn.titleLabel.text = [[model.detail objectAtIndex:0]objectForKey:@"operator"];
                [btn.titleLabel setFont:[UIFont systemFontOfSize:12]];
                [btn addTarget:self action:@selector(pingjia:) forControlEvents:UIControlEventTouchUpInside];
                [self addSubview:btn];
            }

            
            
            
        }
        else if (section == 1){
            
            CGFloat kContentW = UBO_WINDOW.width - 2*kMargin - kNameW;
            
            UILabel * nameLab = [[UILabel alloc]initWithFrame:CGRectOf([self.ubo fx:0 ox:kMargin fy:UB_1_2 oy:-kNameH/2], [self.ubo ow:kNameW oh:kNameH])];
            [nameLab setFont:[UIFont systemFontOfSize:14]];
            [nameLab setTextColor:[XCommon hexStringToColor:kColor_gray_text]];
            [self addSubview:nameLab];
            
            
            UILabel * contentLab = [[UILabel alloc]initWithFrame:CGRectOf([nameLab.ufo fx:1 fy:0], [self.ubo ow:kContentW oh:kNameH])];
            [contentLab setFont:[UIFont systemFontOfSize:14]];
            [contentLab setTextColor:[XCommon hexStringToColor:kColor_black_text]];
            [self addSubview:contentLab];
            
            
            if (row == 0) {
                
                nameLab.text = @"报修项目：";
                contentLab.text = model.repair_item;
                
            }
            else if (row == 1){
                
                nameLab.text = @"报修时间：";
                contentLab.text = model.creatTime;
                
            }
            else if (row == 2){
                
                nameLab.text = @"联 系 人 ：";
                contentLab.text = model.apply_name;
                
            }
            else if (row == 3){
                
                nameLab.text = @"维修地址：";
                contentLab.text = model.address;
                
            }
            else if (row == 4){
                nameLab.text = @"维修详情：";
                contentLab.text = model.info;
            }else if (row == 5){
                nameLab.text = @"参考维修费：";
                NSString * str = [NSString stringWithFormat:@"%@",model.reference_price];
                if (![str isEqualToString:@"<null>"]) {
                    contentLab.text = [NSString stringWithFormat:@"%@",model.reference_price];
                }else
                {
                    contentLab.text = @"00.00";
                }
                
                
                
                [nameLab setTextColor:[UIColor redColor]];
                [contentLab setTextColor:[UIColor redColor]];
            }
            else if (row == 6){
                 self.userInteractionEnabled = YES;
                
                nameLab.text = @"维修图片：";
                contentLab.hidden = YES;
                
                CGFloat picwidth = (UBO_SCREEN.width - nameLab.frame.size.width-12)/4;
                
                NSString * str = @"http://mylife114.com/repair_apply_images/";
                
                NSMutableArray * array = [NSMutableArray array];
                
                NSDictionary * dic = [model.images objectAtIndex:0];
                
                NSString * image1 = dic[@"image_1"];
                NSString * image2 = dic[@"image_2"];
                NSString * image3 = dic[@"image_3"];
                NSString * image4 = dic[@"image_4"];
                
                NSString * url1 = [NSString stringWithFormat:@"%@%@",str,image1];
                NSString * url2 = [NSString stringWithFormat:@"%@%@",str,image2];
                NSString * url3 = [NSString stringWithFormat:@"%@%@",str,image3];
                NSString * url4 = [NSString stringWithFormat:@"%@%@",str,image4];
                
                [array addObject:url1];
                [array addObject:url2];
                [array addObject:url3];
                [array addObject:url4];
                
                
                for (int i = 0; i < array.count; i++) {
                    
                    UIImageView * iv = [[UIImageView alloc]initWithFrame:CGRectOf([nameLab.ufo fx:1 ox:(i+1)*4+i*picwidth fy:0], [self.ubo ow:picwidth oh:picwidth])];
                    //                    iv.backgroundColor = [UIColor blueColor];
                    iv.userInteractionEnabled = YES;
                    [self addSubview:iv];
                    
                    [iv sd_setImageWithURL:[NSURL URLWithString:[array objectAtIndex:i]]];
                    
                    UIButton * btn = [[UIButton alloc]initWithFrame:CGRectOf([iv.ubo fx:0 fy:0], [iv.ubo ow:picwidth oh:picwidth])];
                    btn.tag = i;
//                    btn.backgroundColor = [UIColor blueColor];
                    btn.titleLabel.text = [array objectAtIndex:i];
                    [btn addTarget:self action:@selector(picTop:) forControlEvents:UIControlEventTouchUpInside];
                    [iv addSubview:btn];
                   

                    
                    
                }

                
                
            }
            
            
            
        }
        else {
            
            for (int i = 0; i < model.detail.count; i++) {
                NSDictionary * dic = [model.detail objectAtIndex:i];
                if (section == 2+i) {
                    
                    CGFloat kContentW = UBO_WINDOW.width - 2*kMargin - kNameW;
                    
                    UILabel * nameLab = [[UILabel alloc]initWithFrame:CGRectOf([self.ubo fx:0 ox:kMargin fy:UB_1_2 oy:-kNameH/2], [self.ubo ow:kNameW oh:kNameH])];
                    [nameLab setFont:[UIFont systemFontOfSize:14]];
                    [nameLab setTextColor:[XCommon hexStringToColor:kColor_gray_text]];
                    [self addSubview:nameLab];
                    
                    
                    UILabel * contentLab = [[UILabel alloc]initWithFrame:CGRectOf([nameLab.ufo fx:1 fy:0], [self.ubo ow:kContentW oh:kNameH])];
                    [contentLab setFont:[UIFont systemFontOfSize:14]];
                    [contentLab setTextColor:[XCommon hexStringToColor:kColor_black_text]];
                    [self addSubview:contentLab];
                    
                    
                    if (row == 0) {
                        
                        nameLab.frame = CGRectOf([self.ubo fx:0 ox:kMargin fy:UB_1_2 oy:-kNameH/2], [self.ubo ow:120 oh:kNameH]);
                        nameLab.text = @"是否有偿服务：";
                        contentLab.frame = CGRectOf([nameLab.ufo fx:1 ox:2 fy:0], [self.ubo ow:kContentW oh:kNameH]);
                        if (model.is_charged.integerValue == 0) {
                            contentLab.text = @"无偿";
                        }else
                        {
                            contentLab.text = @"有偿";
                        }
                        
                        self.backgroundColor = [UIColor redColor];
                        [nameLab setTextColor:[UIColor whiteColor]];
                        [contentLab setTextColor:[UIColor whiteColor]];
                        
                        
                        
                    }
                    else if (row == 1){
                        
                        nameLab.text = @"维 修 方 ：";
                        
                        if ([dic[@"maintainer"] isKindOfClass:NSNull.class] || [dic[@"maintainer"]length] == 0) {
                            contentLab.text = @"暂无信息";
                        }else
                        {
                            contentLab.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"maintainer"]];
                        }
                        
                        
                        
                    }
                    else if (row == 2){
                        
                        nameLab.text = @"开始时间：";
                        
                        if ([dic[@"detail_begin_at"] isKindOfClass:NSNull.class] || [dic[@"detail_begin_at"]length] == 0) {
                            contentLab.text = @"暂无信息";
                        }else
                        {
                            contentLab.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"detail_begin_at"]];
                        }
                        
                        
                        
                    }
                    else if (row == 3){
                        nameLab.text = @"结束时间：";
                        
                        if ([dic[@"detail_end_at"] isKindOfClass:NSNull.class] || [dic[@"detail_end_at"]length] == 0) {
                            contentLab.text = @"暂无信息";
                        }else
                        {
                            contentLab.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"detail_end_at"]];
                        }
                        
                        
                        
                        
                    }
                    else if (row == 4){
                        nameLab.text = @"维修结果：";
                        
                        if ([dic[@"detail_result"] isKindOfClass:NSNull.class] || [dic[@"detail_result"]length] == 0) {
                            contentLab.text = @"暂无信息";
                        }else
                        {
                            contentLab.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"detail_result"]];
                        
                        }
                        
                        
                    
                    }
                    else if (row == 5){
                        
                        nameLab.text = @"录入时间：";
                        
                        if ([dic[@"detail_created_at"] isKindOfClass:NSNull.class] || [dic[@"detail_created_at"]length] == 0) {
                            contentLab.text = @"暂无信息";
                        }else
                        {
                            contentLab.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"detail_created_at"]];
                        }
                        
                        
                        
                    }
                    else if (row == 6){
                        
                        nameLab.text = @"维修报价：";
                        
                        if ([dic[@"reference_price"] isKindOfClass:NSNull.class] || [dic[@"reference_price"]length] == 0) {
                            contentLab.text = @"暂无信息";
                        }else
                        {
                           contentLab.text = [NSString stringWithFormat:@"%@",dic[@"reference_price"]];
                        }
                        
                        
                        
                        [nameLab setTextColor:[UIColor redColor]];
                        [contentLab setTextColor:[UIColor redColor]];

                        
                        if ([model.status isEqualToString:@"待处理"]) {
                            nameLab.hidden = YES;
                            contentLab.hidden = YES;
                        }else
                        {
                            nameLab.hidden = NO;
                            contentLab.hidden = NO;
                            
                        }
                        
                        
                    
                    }
                    else if (row == 7){
                        
                        
                        nameLab.text = @"实际维修费：";
                        if ([dic[@"real_money"] isKindOfClass:NSNull.class] || [dic[@"real_money"]length] == 0){
                            
                            contentLab.text = @"暂无信息";
                            
                        }else
                        {
                            contentLab.text = [NSString stringWithFormat:@"%@",dic[@"real_money"]];
                        }
                        
                        
                        
                        [nameLab setTextColor:[UIColor redColor]];
                        [contentLab setTextColor:[UIColor redColor]];
                        
                        
                        UIButton * btn = [[UIButton alloc]initWithFrame:CGRectOf([self.ubo fx:1 ox:-80 fy:0 ], [self.ubo ow:80 oh:kNameH])];
                        [btn setTitle:@"-收费明细-" forState:UIControlStateNormal];
                        [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
                        [btn.titleLabel setFont:[UIFont systemFontOfSize:12]];
                        [btn addTarget:self action:@selector(shoufeimingxi:) forControlEvents:UIControlEventTouchUpInside];
                        btn.tag = [dic[@"distribute_id"]integerValue];
                        [self addSubview:btn];
                        
                        
                        if ([model.status isEqualToString:@"待处理"]) {
                            nameLab.hidden = YES;
                            contentLab.hidden = YES;
                            btn.hidden = YES;
                        }else
                        {
                            nameLab.hidden = NO;
                            contentLab.hidden = NO;
                            btn.hidden = NO;
                        }
                        
                    }
                    
                    
                    
                }
                
                
            }
            
            
        }
        
        
    }
    
    
   
}


-(void)shoufeimingxi:(UIButton*)sender
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(lookShoufeimingxi:)]) {
        [self.delegate lookShoufeimingxi:sender];
    }
}

-(void)pingjia:(UIButton*)sender
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(gopingjia:)]) {
        [self.delegate gopingjia:sender];
    }
}

-(void)picTop:(UIButton*)sender
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(scanBigPic:)]) {
        [self.delegate scanBigPic:sender];
    }
}



@end
